package com.gjintel.business.dbmanage.service.impl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.gjintel.business.dbmanage.dao.IDataBaseManagerDao;
import com.gjintel.business.dbmanage.service.IDataBaseManageService;
import com.gjintel.sdk.base.service.impl.BaseServiceImpl;
@Service
public class DataBaseManaerServiceImpl extends BaseServiceImpl implements IDataBaseManageService{
	
	@Resource
	private IDataBaseManagerDao dataBaseManagerDaoImpl;

	@Override
	public List<Map<String,String>> getAllTableNames(String schema) {
		List<Object> tableNames = this.dataBaseManagerDaoImpl.getAllTableNames(schema);
		List<Map<String,String>> resultList = new ArrayList<Map<String,String>>();
		for(Object obj : tableNames){
			String name = (String)obj;
			Map<String,String> tempMap = new HashMap<String,String>();
			tempMap.put("tableName", name.toUpperCase());
			resultList.add(tempMap);
		}
		return resultList;
	}
}
